if (!isPrimary && !haveTopLeftCorner)
continue;
- let corner = new Panel.HotCorner();
+ let corner = new Panel.HotCorner(isPrimary ? panel.button : null);
hotCorners.push(corner);
corner.actor.set_position(cornerX, cornerY);
if (isPrimary)
* This class manages the "hot corner" that can toggle switching to
* overview.
*/
-function HotCorner() {
- this._init();
+function HotCorner(button) {
+ this._init(button);
}
HotCorner.prototype = {
- _init : function() {
+ _init : function(button) {
+ // This is the activities button associated with this hot corner,
+ // if this is on the primary monitor (or null with the corner is
+ // on a different monitor)
+ this._button = button;
+
// We use this flag to mark the case where the user has entered the
// hot corner and has not left both the hot corner and a surrounding
// guard area (the "environs"). This avoids triggering the hot corner
this._activationTime = 0;
+ this.actor.connect('enter-event',
+ Lang.bind(this, this._onEnvironsEntered));
this.actor.connect('leave-event',
Lang.bind(this, this._onEnvironsLeft));
// Clicking on the hot corner environs should result in the same bahavior
this._addRipple(0.35, 1.0, 0.0, 0.3, 1, 0.0);
},
+ _onEnvironsEntered : function() {
+ if (this._button)
+ this._button.hover = true;
+ },
+
_onCornerEntered : function() {
if (!this._entered) {
this._entered = true;
},
_onEnvironsLeft : function(actor, event) {
+ if (this._button)
+ this._button.hover = false;
+
if (event.get_related() != this._corner)
this._entered = false;
return false;